#include <stdlib.h>
#include <stdio.h>

#define M 2
#define N 3
#define K 2

	int main()
{
	int a[M][N] = {1,2,3,4,5,6};
	int b[N][K] = {4,5,6,7,8,9};
	int c[M][K] = {0};
	int i,j,k;

	for(i = 0;i < M;i++)
	{
		for(j = 0;j < K;j++)
		{
			for(k = 0;k < N;k++)
			{
				c[i][j] += a[i][k] * b[k][j];
			}
		}
	}
	for(i = 0;i < M;i++)
	{
		for(j = 0;j < K;j++)
			printf("%4d",c[i][j]);
		printf("\n");
	}	
	exit(0);
}
